local skel = fk.CreateSkill {
  name = "efengqi__polu",
  tags = {Skill.Compulsory},
}

Fk:loadTranslationTable{
  ["efengqi__polu"] = "破虏",
  [":efengqi__polu"] = "锁定技，你对手牌数不大于X的角色造成伤害+1 （X为【古锭刀】被使用次数）。",
  ["@efengqi__polu"] = "破虏",

  ["$efengqi__polu1"] = "匹夫犯我，吾必斩之。",
  ["$efengqi__polu2"] = "鼠辈，这一刀下去定让你看不到明天的太阳。",
}

skel:addEffect(fk.DamageCaused, {
  anim_type = "offensive",
  can_trigger = function (self, event, target, player, data)
    return target == player and player:hasSkill(skel.name) and data.to:getHandcardNum() <= player:getMark("@efengqi__polu")
  end,
  on_cost = function (self, event, target, player, data)
    event:setCostData(self, {tos = {data.to}})
    return true
  end,
  on_use = function (self, event, target, player, data)
    data:changeDamage(1)
  end,
})

skel:addAcquireEffect(function (self, player, is_start)
  local n = #player.room.logic:getEventsOfScope(GameEvent.UseCard, 999, function(e)
    local use = e.data
    return use.card.name == "guding_blade"
  end, Player.HistoryGame)
  player.room:setPlayerMark(player, "@efengqi__polu", n)
end)

skel:addLoseEffect(function (self, player, is_death)
  player.room:setPlayerMark(player, "@efengqi__polu", 0)
end)

skel:addEffect(fk.CardUsing, {
  can_refresh = function (self, event, target, player, data)
    return data.card.name == "guding_blade" and player:hasSkill(skel.name, true)
  end,
  on_refresh = function (self, event, target, player, data)
    player.room:addPlayerMark(player, "@efengqi__polu")
  end,
})

return skel
